package com.lwq.nacos.grayscale.gray;

import lombok.Getter;
import lombok.Setter;

import java.util.Collections;
import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;

@Setter
@Getter
public class NacosMetaDataContext {

    private Map<String, String> nacosMateMap = new ConcurrentHashMap<>();

    public NacosMetaDataContext put(String key, String value) {
        nacosMateMap.put(key, value);
        return this;
    }

    public String get(String key) {
        return nacosMateMap.get(key);
    }

    public NacosMetaDataContext remove(String key) {
        nacosMateMap.remove(key);
        return this;
    }

    public void clear(){
        nacosMateMap.clear();
    }
    
    public Map<String, String> getNacosMateMap() {
        return Collections.unmodifiableMap(nacosMateMap);
    }

}